package com.huike.report.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.huike.report.domain.vo.DragonTigerRankVO;
import com.huike.report.domain.vo.SubjectStatisticsVO;
import com.huike.report.domain.vo.VulnerabilityMapVo;
import org.apache.ibatis.annotations.Param;

import com.huike.clues.domain.vo.IndexStatisticsVo;

/**
 * 首页统计分析的Mapper
 * @author Administrator
 *
 */
public interface ReportMapper {
	/**=========================================基本数据========================================*/
	/**
	 * 获取线索数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getCluesNum(@Param("startTime") String beginCreateTime,
						@Param("endTime") String endCreateTime,
						@Param("username") String username);

	/**
	 * 获取商机数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getBusinessNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getContractNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同金额
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Double getSalesAmount(@Param("startTime") String beginCreateTime,
						  @Param("endTime") String endCreateTime,
						  @Param("username") String username);



    /**=========================================今日简报========================================*/
	Integer getTodayCluesNum(@Param("username") String username,@Param("nowDate") String nowDate);

	Integer getTodayBusinessNum(@Param("username")String username,@Param("nowDate") String nowDate);

	Integer getTodayContractNum(@Param("username")String username,@Param("nowDate") String nowDate);

	Double getTodaySalesAmount(@Param("username")String username,@Param("nowDate") String nowDate);




	/**=========================================待办========================================*/
	Integer getTofollowedCluesNum(@Param("username")String username,
								  @Param("beginCreateTime") String beginCreateTime,
								  @Param("endCreateTime") String endCreateTime);

	Integer getTofollowedBusinessNum(@Param("username")String username,
									 @Param("beginCreateTime") String beginCreateTime,
									 @Param("endCreateTime") String endCreateTime);

	Integer getToallocatedCluesNum(@Param("username")String username,
								   @Param("beginCreateTime") String beginCreateTime,
								   @Param("endCreateTime") String endCreateTime);

	Integer getToallocatedBusinessNum(@Param("username")String username,
									  @Param("beginCreateTime") String beginCreateTime,
									  @Param("endCreateTime") String endCreateTime);

	//统计分析-客户统计-学科客户分布饼图
	List<SubjectStatisticsVO> getSubjectStatistics(@Param("beginCreateTime") String beginCreateTime,
												   @Param("endCreateTime") String endCreateTime);

	//线索统计--新增线索数量折线图
	List<Map<String, Object>> getCluesStatistics(@Param("beginCreateTime") String beginCreateTime,
												 @Param("endCreateTime") String endCreateTime);

	//统计分析--线索统计--线索转化率漏斗图
	Integer getCluesNums(@Param("beginCreateTime") String beginCreateTime,
						 @Param("endCreateTime") String endCreateTime);


	Integer getEffectiveCluesNums(@Param("beginCreateTime") String beginCreateTime,
								  @Param("endCreateTime") String endCreateTime);

	Integer getBusinessNums(@Param("beginCreateTime") String beginCreateTime,
								  @Param("endCreateTime") String endCreateTime);

	Integer getContractNums(@Param("beginCreateTime") String beginCreateTime,
							@Param("endCreateTime") String endCreateTime);

	//首页数据--商机转化龙虎榜
    List<DragonTigerRankVO> getBusinessChangeStatistics(@Param("beginCreateTime") String beginCreateTime,
														@Param("endCreateTime") String endCreateTime);

	Integer getBusinessCount(@Param("beginCreateTime") String beginCreateTime,
							 @Param("endCreateTime") String endCreateTime);

	//首页数据--线索转化龙虎榜
	List<DragonTigerRankVO> getSalesStatistic(@Param("beginCreateTime") String beginCreateTime,
											  @Param("endCreateTime") String endCreateTime);
}
